package com.karson.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.karson.common.dto.rabbitmq.StaticMessage;
import com.karson.common.model.ActionCounts;
import com.karson.common.model.ArAlbumTag;
import com.karson.service.dao.ActionCountsMapper;
import com.karson.service.service.IStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.LongAdder;

/**
 * 点赞策略
 * @author ZKS
 */
@Component("like")
public class LikeStatisticService extends AbstractStatisticService {

    @Autowired
    private ActionCountsMapper actionCountsMapper;

    @Override
    protected void flushToDatabase(StaticMessage key, long count) {
        actionCountsMapper.incrementLikeCount(
                key.getMessageId(),
                count,
                key.getType()
        );
    }
}